/*
 * @Author: TC (tengchao@taqu.cn)
 * @Date: 2025-10-11 11:10:33
 * @Last Modified by: TC (tengchao@taqu.cn)
 * @Last Modified time: 2025-10-11 11:18:41
 */

import { _decorator, Node } from "cc";
import { BaseUI } from "db://assets/FrameWork/Module/Component/BaseUI";
import { gameMole } from "../../GameMole";
import { app } from "db://assets/FrameWork/App";
import { EMoleUIConst } from "../../Const/MoleUIConst";
const { ccclass, property } = _decorator;

/**
 * 准备界面
 */
@ccclass("MolePauseUI")
export class MolePauseUI extends BaseUI {
    @property({ type: Node, displayName: "继续按钮" })
    private btnContinue: Node = null;
    @property({ type: Node, displayName: "返回按钮" })
    private btnBack: Node = null;

    protected init(): void {
        super.init();
    }

    protected addUIEvent(): void {
        super.addUIEvent();
        this.addClickEvent(this.btnContinue, this._onContinue);
        this.addClickEvent(this.btnBack, this._onBack);
    }

    /**
     * 点击继续
     */
    private _onContinue(): void {
        gameMole.battleMgr.resume();
        this.closeUI();
    }

    /**
     * 点击返回
     */
    private _onBack(): void {
        app.uiMgr.openUI(EMoleUIConst.ExitUI);
    }
}
